<?php
namespace app\index\controller;
use think\View, think\Controller;

class News extends Controller{
    
  //   protected $beforeActionList = [
  //     'first',
  //     'second' =>  ['except'=>'hello'],
  //     'three'  =>  ['only'=>'hello,data'],
  // ];

    protected function first()
    {
        echo 'first<br/>';
    }

    protected function second()
    {
        echo 'second<br/>';
    }

    protected function three()
    {
        echo 'three<br/>';
    }

    public function hello()
    {
        // $this -> error('ok');exit;
        return 'hello';
    }

    public function data()
    {
        return 'data';
    }


    public function _initialize() {
        echo 'init<br>';
    }

    public function read($id) {
    echo 'read'.'<br/>';
    p($this -> request -> header());die;
    return \think\Url::build('/new','id=5', '', true);
    return $id;
		$id = input('id');
		var_dump($id);
    }

    public function index() {
      // $view = new View();
      // return $view -> fetch('index');
      return $this -> request -> url(true);
      return view('index');
    }
}
